<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<!--The content below is only a placeholder and can be replaced.-->

<link rel="stylesheet" href="/bootstrap/css/bootstrap.css">


<%- include ../public/header.ejs %>


<div class="container-fluid">
    <div class="row">
        <div class="col-sm-2">
            <%- include ../public/aslideleft.ejs %>

        </div>
        <div class="col-sm-10">
            <ol class="breadcrumb">
                <li class="active">商品管理
                </li>
                <li class="active">商品列表
                </li>
            </ol>
            <div class="panel panel-default">
                <div class="panel-heading">
                    搜索
                </div>
                <div class="panel-body">
                    <form role="form" class="form-inline" method="post" action="/admin/product/search" enctype="multipart/form-data">
                        <div class="form-group">
                            <label for="name">名称</label>
                            <input type="text" class="form-control" name="searchName" value="<%=searchName%>" id="name" placeholder="请输入名称">
                        </div>

                        <div class="form-group">
                            <button type="submit" class="btn btn-default">开始搜索</button>
                        </div>
                    </form>
                </div>
            </div>
            <!--
                列表展示
            -->
            <div class="table-responsive">
                <table class="table table-striped ">
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>图标</th>
                        <th>名称</th>
                        <th>价格</th>
                        <th>邮费</th>

                        <th class="text-center">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <%for(var i=0; i<products.length; i++){%>
                        <tr>
                            <td><%=i+1%></td>
                            <td><img style="float:left; height: 80px; width: 120px" src="/<%=products[i].pic%>" alt=""></td>
                            <td><%=products[i].title%></td>
                            <td><%=products[i].price%></td>
                            <td><%=products[i].fee%></td>

                            <td class="text-center">
                                <a style="width: 40px;height: 25px;display: inline-block;line-height: 25px;border-radius: 5px;" href="/admin/product/edit?id=<%=products[i]._id%>" class="btn-success">修改</a>&nbsp;&nbsp;
                                <a style="width: 40px;height: 25px;display: inline-block;line-height: 25px;border-radius: 5px;" href="/admin/product/del?id=<%=products[i]._id%>" class="btn-danger">删除</a>
                            </td>
                        </tr>
                    <%}%>

                    </tbody>
                </table>
            </div>

        </div>
    </div>
</div>

</body>
</html>